﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="BaoCaoDemo.ascx.cs" Inherits="UserControl_BaoCaoDemo" %>

<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>

<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPivotGrid" tagprefix="dxwpg" %>
<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2.Export, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.XtraPivotGrid.Web" tagprefix="dxpgw" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dxpc" %>


<script type="text/javascript">
    function pageLoad() {

       

        $("#<%= imgBtnAdd.ClientID %>").click(function () {
           
                $.blockUI({
                    message: '<h1>Xin vui lòng chờ xử lý</h1>',
                    css: {
                        border: 'none',
                        padding: '15px',
                        backgroundColor: '#f00',
                        opacity: .5,
                        color: '#fff'
                    }
                });
            
        });
        $("#<%= imgBtnSave.ClientID %>").click(function () {
            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });
            setTimeout($.unblockUI, 5000);
        });
        $("#<%= ImgBtnRefresh.ClientID %>").click(function () {
            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });
            setTimeout($.unblockUI, 5000);
        });

        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            $.unblockUI();
        }

    }

</script>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="imgBtnSave" />

</Triggers>
    <ContentTemplate>
    
                <div class="direct_container_right_titletop direct_colleft">
                    Báo cáo doanh số theo mặt hàng
                </div>
                
                <!-- Button chuc nang-->
                <div class="direct_menu_report_page direct_colleft">
                
                    <asp:RadioButton GroupName="select" ID="RMonth" Checked="true" Text="Xem theo tháng" runat="server" />
                    <asp:DropDownList ID="DropMonthy" runat="server">
                    </asp:DropDownList>
                   
                   <%-- <asp:RadioButton GroupName="select" ID="RDate" Text="Xem theo quý" runat="server" />
                    <asp:DropDownList ID="DropQuy" runat="server">
                    </asp:DropDownList>--%>
                    <asp:ImageButton ID="imgBtnAdd" CausesValidation="false" onclick="imgBtnAdd_Click" ToolTip="Lấy dữ liệu"  ImageUrl="~/Images/Document.png" Width="32px" Height="32px" runat="server" />
                    <asp:ImageButton ID="imgBtnSave" onclick="imgBtnSave_Click" CausesValidation="false" ToolTip="Xuất ra file excel dạng thường" ImageUrl="~/Images/download.png" Width="32px" Height="32px" runat="server" />
                    <asp:ImageButton ID="ImgBtnRefresh" onclick="imgBtnRefresh_Click" CausesValidation="false" ToolTip="Reset lại dữ liệu" ImageUrl="~/Images/Refresh.png" Width="32px" Height="32px" runat="server" />
                    
                </div>
                <!-- End Button chuc nang-->
                <div class="clear"></div>
                 <hr />

                
                   <table>
                   
                    <tr>
                    <td>
                      <dxpgw:ASPxPivotGridExporter ID="ASPxPivotGridExporter1" ASPxPivotGridID="ASPxPivotGrid1" runat="server" Width="100%">
        </dxpgw:ASPxPivotGridExporter>
        <dxwpg:ASPxPivotGrid ID="ASPxPivotGrid1" CustomizationFieldsVisible="True"  
                            runat="server">
                 <Fields>
                <dxwpg:PivotGridField ID="PivotMSVT" Area="FilterArea"  AreaIndex="0"
                         Caption="Tên hàng theo NPP" FieldName="MSVT" Visible="False">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="PivotQTY" Area="FilterArea"  AreaIndex="1" 
                         Caption="Số lượng" FieldName="QTY" Visible="False">
                </dxwpg:PivotGridField>
                
                <dxwpg:PivotGridField ID="PivotDGLE" Area="FilterArea"  AreaIndex="2" 
                         Caption="Giá bán" FieldName="DGLE" Visible="False">
                </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="PivotChannelName" Area="FilterArea"  AreaIndex="3" 
                         Caption="Channel" FieldName="ChannelName" Visible="False">
                </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="PivotVAT" Area="FilterArea"  AreaIndex="4" 
                         Caption="VAT" FieldName="VAT" Visible="False">
                </dxwpg:PivotGridField>
               
                
                <dxwpg:PivotGridField ID="PivotChannelSKU" Area="FilterArea"  AreaIndex="5" 
                         Caption="Nhóm sản phẩm" FieldName="Channel" Visible="False">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="PivotGroupSKU" Area="FilterArea"  AreaIndex="6" 
                         Caption="Gam hàng" FieldName="Group" Visible="False">
                </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="Pivotsitename" Area="FilterArea"  AreaIndex="7" 
                         Caption="Nhà phân phối" FieldName="sitename" Visible="False">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="Pivottrntyp" Area="FilterArea"  AreaIndex="8" 
                         Caption="Loại hàng" FieldName="trntyp" Visible="False">
                </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="PivotNgay" Area="FilterArea"  AreaIndex="9" 
                         Caption="Ngày" FieldName="NGAY" Visible="False">
                </dxwpg:PivotGridField>
               
                <dxwpg:PivotGridField ID="PivotMSVTFimex" Area="RowArea"  AreaIndex="1" 
                         Caption="Tên hàng theo Fimex" FieldName="MSVTFimex">
                </dxwpg:PivotGridField>
               

             
                 
                 <dxwpg:PivotGridField ID="PivotTT" Area="DataArea"  AreaIndex="0" 
                         Caption="Thành tiền (CK)" CellFormat-FormatString="{0:###,###.###}" 
                         CellFormat-FormatType="Numeric" FieldName="TT">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="PivotThanhTienCKVAT" Area="DataArea"  AreaIndex="1" 
                         CellFormat-FormatString="{0:###,###.###}" CellFormat-FormatType="Numeric" 
                         Caption="Thành tiền (CK+VAT)" FieldName="TTV">
                </dxwpg:PivotGridField>

                </Fields>
                <OptionsPager Visible="false">
               </OptionsPager>
        </dxwpg:ASPxPivotGrid>
                    </td>
                    </tr>
                 </table>
                              
             <dxpc:ASPxPopupControl ID="MessageBox" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="DRM-S" runat="server" Height="91px" 
        Width="601px">
        <ContentCollection>
<dxpc:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True"></dxpc:PopupControlContentControl>
</ContentCollection>
    </dxpc:ASPxPopupControl>
    </ContentTemplate>
</asp:UpdatePanel>